package com.young.config;

import javax.sql.DataSource;
import java.util.HashMap;
import java.util.Map;

/**
 * 描述:对应mybatis-config.xml文件的数据结构
 *
 * @author BluceYoung
 * @create 2020-07-01 15:01
 * B站：TeacherYoung凌风
 * www.teacheryoung.com
 */
public class Configuration {

    private DataSource dataSource;
    private Map<String,MappedStatement> mappedStatementMap=new HashMap<String,MappedStatement>();

    public DataSource getDataSource() {
        return dataSource;
    }

    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }

    public MappedStatement getMappedStatementById(String statementId){
        return mappedStatementMap.get(statementId);
    }

    public void addMappedStatement(String statementId,MappedStatement mappedStatement){
        mappedStatementMap.put(statementId,mappedStatement);
    }
}
